#include <iostream>
using namespace std;
int main()
/*
 * 可以利用sizeof求出数据类型占用的内存大小*/
{
    short num1 =10;
//短整型
    cout<<"short占用的内存空间："<<sizeof (short )<<endl;
    cout<<"short占用的内存空间："
        <<sizeof (short )
        <<endl;
    int num2 = 10;
//整型
    cout<<"int占用的内存空间："<<sizeof (int )<<endl;

    long num3 = 10;
//长整型
    cout<<"long占用的内存空间："<<sizeof (long )<<endl;

    long long num4 = 10;
//长长整型
    cout<<"long long占用的内存空间："<<sizeof (long long )<<endl;
/*short < int <=long <= long long*/
    cout<<"num1 ="<< num1<<endl;
    cout<<"num2 ="<< num2<<endl;
    cout<<"num3 ="<< num3<<endl;
    cout<<"num4 ="<< num4<<endl;
    /*所占的内存空间不同，表示的最大范围不同*/

    system("pause");
    return 0;
}